setwd("/mnt/md1200/6/yjp/5hmc_analysis_hg19_new/20201207")
filea=read.csv("all.FDR.sig.at.least.one.add.direction.same.diff.csv",header=T)
filea$id=paste(filea$Chr,filea$Start,sep = ":")
filea1=filea[filea$FDR.sig>1,]
file=read.table("E:/5hmc_file/2_5hmc_yjp_bam/ASM/20210316LIBD.eQTL处理/53K.add.GWAS.eQTL.DEG.motif.for.analysis.txt",header=T,sep="\t")
#file$id=paste(file$Chr,file$Start,sep=":")
file1=file[file$pattern.not.rm.dupl.num.DC>1,]
file2=file1[file1$BF_in_DC>1,]
file3=file1[file1$BF_in_DC>10,]

###筛选位点
tar=file3[file3$eQTL.no.na.num>0,]
tar=tar[tar$gwas.no.na.num>0,]
#tar=tidyr::separate_rows(tar,geneSymbol,sep=";")

tf=read.csv("E:/5hmc_file/2_5hmc_yjp_bam/ASM/20210103.motif.analysis/cor.mean.vaf.vs.score.allele.diff.csv",header = T)
id=tf[tf$cor.p.value<0.05&abs(tf$cor.estimate)>0.7,]$TF

tmp=tar[tar$geneSymbol %in% id,]
write.csv(tmp,"4.coordinated.locis.csv",quote=F,row.names = F)
